package com.java.pertar.testmybatis.Controller;

import com.java.pertar.testmybatis.Modle.UserInfo;
//import com.java.pertar.testmybatis.Modle.stu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.support.JstlUtils;

import java.util.List;


@Mapper
public interface Test1 {

    @Select("select * from user_info")
    List<UserInfo> selectAll();

    @Select("select * from user_info where id = #{id}")
    UserInfo selectById(int id);

    @Select("select * from user_info where id = ${id}")
    UserInfo selectById2(int id);

    @Select("select * from user_info where username = #{username} and password = #{password}")
    UserInfo selectByUsernameAndPassword(String username, String password);

    @Select("select * from user_info where username = '${username}' and password = '${password}'")
    UserInfo selectuserpass(String username, String password);

    @Select("select * from user_info where username = '${username}' and password = '${password}'")
    List<UserInfo> selectuserpass2(String username, String password);

    @Select("select * from user_info order by id ${s}")
    List<UserInfo> selectuserpass3(String s);

    @Select("select * from user_info where username like '%${s}%'")
    List<UserInfo> selectuserpass4(String s);

    @Select("select * from user_info where username like concat('%', #{s}, '%')")
    List<UserInfo> selectuserpass5(String s);
}
